# 交叉编译
arch ?= x86
# arch ?= arm

ifeq ($(arch), arm)
	kernel_dir = /home/linux/linux5.10.61
else
	kernel_dir = /lib/modules/5.4.0-150-generic/build
endif

pwd = $(shell pwd)

KBUILD_EXTRA_SYMBOLS += /home/linux/linux-drive/TestModules/01-3模块依赖与导出符号/my_test_modoleA/Module.symvers

all:
	make -C $(kernel_dir) modules M=$(pwd) 
clean:
	make -C $(kernel_dir) clean M=$(pwd)
install:
	make -C $(kernel_dir) modules_install M=$(pwd) INSTALL_MOD_PATH=/home/linux/rootfs  
# INSTALL_MOD_PATH：module安装到指定的路径下

obj-m += my_test_moduleB.o # 会自动找 my_test_moduleB.c 文件的